﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.guide.ui {
    import flash.display.*;
    import flash.utils.*;
    import Display.DialogUI.*;
    import org.aswing.*;
    import Classes.*;
    import flash.text.*;
    import org.aswing.border.*;
    import Display.aswingui.*;

    public class GuideDialogView extends GenericDialogView {

        public static const ADVISOR_LOCATION_LEFT:String = "left";
        public static const ADVISOR_LOCATION_RIGHT:String = "right";
        private static const ADVISOR_TOPOFFSET:int = 102;
        private static const ADVISOR_LEFTOFFSET:int = 104;
        private static const SPEECHBUBBLE_TOPOFFSETRATIO:Number = 0.45;

        protected var m_speech:DisplayObject;
        protected var m_advisorLocation:String;

        public function GuideDialogView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null, _arg6:String="right"){
            this.m_advisorLocation = _arg6;
            super(_arg1, _arg2, _arg3, _arg4, _arg5);
        }
        override protected function init():void{
            this.m_speech = m_assetDict["speechBubble"];
            this.makeCenterPanel();
            this.makeBackground();
            ASwingHelper.prepare(this);
        }
        override protected function makeBackground():void{
        }
        override protected function makeCenterPanel():void{
            var _local6:AssetPane;
            m_interiorHolder = new JPanel(new FlowLayout(FlowLayout.LEFT));
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            _local1.setBackgroundDecorator(new MarginBackground(this.m_speech, new Insets(0, 0, 0, 0)));
            var _local3:int = Math.max(200, (m_message.length * 1.5), (m_titleString.length * 1.5));
            if (m_titleString){
                _local6 = ASwingHelper.makeMultilineCapsText(m_titleString, _local3, EmbeddedArt.TITLE_FONT, TextFormatAlign.LEFT, 16, EmbeddedArt.darkBlueTextColor, null, true);
                _local2.append(_local6);
            };
            var _local4:AssetPane = ASwingHelper.makeMultilineText(m_message, _local3, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.LEFT, 16, EmbeddedArt.brownTextColor, null, true);
            _local2.append(_local4);
            var _local5:Insets = ((this.m_advisorLocation == ADVISOR_LOCATION_RIGHT)) ? new Insets(10, 25, 20, 50) : new Insets(10, 50, 20, 25);
            _local2.setBorder(new EmptyBorder(null, _local5));
            _local1.append(_local2);
            ASwingHelper.prepare(_local1);
            m_interiorHolder.append(_local1);
            ASwingHelper.prepare(m_interiorHolder);
            this.append(m_interiorHolder);
            ASwingHelper.prepare(this);
        }

    }
}//package Modules.guide.ui 
